﻿using System;

namespace 二维数组
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,]arr=new int[3,2];
            for (var i = 0; i < arr.GetLength(0); i++)
            {
                for (var j = 0; j < arr.GetLength(1); )
                {
                    do
                    {
                        try
                        {
                            Console.WriteLine("横值:{0},纵值:{1}", i, j);
                            var sum=int.Parse(Console.ReadLine()) ;
                            if (sum >= 0 && sum <= 100)
                            {
                                arr[i, j] = sum;
                                j++;
                            }
                            else
                            {
                                Console.WriteLine("请输入0-100之间的数值!");
                            }
                        }
                        catch (Exception)
                        {

                            Console.WriteLine("输入数值超出系统类型最大值{0}?",int.MaxValue);
                        }


                    } while (j<arr.GetLength(1));
                }
            }
        }
    }
}
